//轮播图
var mySwiper = new Swiper ('.swiper-container', {
    loop: true, // 循环模式选项
    effect : 'coverflow',
    slidesPerView: 3,
    centeredSlides: true,
    autoplay:true,

    // 如果需要前进后退按钮
    navigation: {
        nextEl: '.swiper-button-next',
        prevEl: '.swiper-button-prev'
    }
});


//返回顶部
var kk1 = document.querySelector("#kk1");

var ee1 = document.querySelector("#ee1");

var f1 = document.querySelector("#f1");

var f3 = document.querySelector("#f3");

var f5 = document.querySelector("#f5");

var f7 = document.querySelector("#f7");





//滚动事件，没触发一次，这个事件就执行一次。
window.onscroll = function(){

    //判断他离顶部的距离
    if (document.documentElement.scrollTop > 300 || document.body.scrollTop > 300){
        kk1.style.display = "block";
    }
    else {
        kk1.style.display = "none";
    }



    if (document.documentElement.scrollTop > 225 || document.body.scrollTop > 225){
        ee1.style.position = "fixed";
        ee1.style.top = "0";
    }else {
        ee1.style.position = "relative";
    }





    var t = document.documentElement.scrollTop || document.body.scrollTop;
    console.log(t);

    if (t > 100){
        f1.classList.add("w");
    }
    if (t > 700){
        f3.classList.add("w");
    }
    if (t > 1600){
        f5.classList.add("w");
    }
    if (t > 2200){
        f7.classList.add("w");
    }
};


kk1.addEventListener('click',function(){
    //距离顶部的距离为x为0，y为0.
    //window.scrollTo(0,0);


    window.scrollTo({
        top: 0 ,
        behavior: 'smooth'
    })

});








new Vue({
    el:"#wn2",
    data:{an1:""},
    mounted(){
        axios
            .get('json/json.json')
            .then(response => this.an1 = response.data.ul)
            .catch(function(error){
                console.log(error);
            })
    }


});